package edu.whu.puppygo.dao;

import edu.whu.puppygo.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * @author guanruwang
 * @date 2023/11/8$
 */
@Repository
public interface UserDao extends JpaRepository<User, Long>, JpaSpecificationExecutor<User> {
    Optional<User> findByUsername(String username);

    Optional<User> findByUsernameAndDeleteTimeNull(String username);

    Optional<User> findByAccount(String account);

    Optional<User> findByAccountAndDeleteTimeNull(String account);
}
